There are many occasions when it is necessary to copy a collection of image files 10 onto a floppy disk or send a collection of image files as an attachment to an email message. However, given the transmission time and permissible email attachment size, it may be necessary to limit the total size of the attachment. Similarly, if the file size (in bytes) of each of the original image files in the collection is relatively large, it will often not be possible to fit all of the images in the collection onto a conventional 1.44 MB floppy disk, particularly, since other files may be stored on the floppy disk using some of the available storage. Typically, a person might decide to address these limitations by reducing the number of images that are saved onto a floppy or that will be sent as the email attachment so that the total bytes of the image files will be equal or less than the available storage size on the disk, or sufficiently small to be acceptable as an attachment 20 to an email message.
Another approach that is often employed in addressing this problem is to save each of the images in a compressed file format so that the total size (in bytes) of the compressed images in the collection will fit in the available storage on the floppy disk or be sufficiently small to transmit as an email attachment. While there are other compression standards, one of the more popular compression formats for saving images employs the Joint Photographic Experts Group (JPEG) standard. The file sizes of images compressed using the JPEG standard can be substantially smaller than that of the original decompressed images, but there is a slight disadvantage in using this compression scheme. The JPEG standard employs a “lossy” type of compression, so there is always a loss of some of the data that was in the original decompressed image when the compression scheme is applied and the compressed file is subsequently decompressed for viewing. The lost data cannot be recovered from the compressed image.
The amount of image data that is lost and thus, the quality of the image that is displayable after decompressing the compressed image data is determined by a quality level. The quality level determines the amount of compression applied to the original data in producing the compressed data file. Theoretically, the quality level can range between a minimum quality level of “0” and a maximum quality level of “100,” where a higher quality decompressed image is achieved by reducing the amount of compression that is applied to the image file. However, as a practical matter, it is generally agreed by those skilled in the art that an acceptable compression range can be obtained using a quality level between 5 and 95. If a quality level below 5 is used to compress an image, the appearance of the image after it is subsequently decompressed will often be of too low quality to be usable, while if the quality level is set above 95, the amount of compression (or file size reduction) that is achieved will be too little to justify the use of the compression scheme.
Images can differ substantially in regard to their complexity. An image that consists mostly of large areas having minimal color and contrast variation is much less complex than an image with lots of detail and variation in color and contrast. For example, an image of a uniform color, cloudless sky is much less complex than an image of a maple tree covered with thousands of brightly colored autumn leaves. An image with less complexity can be compressed to a much larger extent than an image of greater complexity, while retaining about the same perceived quality after being decompressed.
Typically, to fit a group of compressed files into a specified storage, the same quality level will be used in compressing each of the image files in the group. However, the results will often be disappointing, since more complex images will lose too much detail and appear unacceptable when subsequently decompressed and displayed. Less complex images will typically be compressed less than they might be and still retain an acceptable quality when decompressed. It would therefore be preferable to employ a higher quality level when compressing images that are more complex and a lower quality level when compressing images that are of lower complexity. Yet, the size of a compressed image file will not be evident until the compression scheme has actually been applied. Consequently, it will be unduly burdensome to manually test different quality levels for use in compressing each image in a collections to arrive at a mix different optimal quality levels that should be applied to ensure that all of the compressed image files in the set will fit on a floppy disk, or be sufficiently small to send as an email attachment. Clearly, it would be desirable to provide a program that can automatically determine an acceptable near optimal quality level that should be used in compressing each image file in a set, so that the total size of the resulting compressed image files is within some specified limit. The program should determine the quality level and thus, the corresponding degree of compression applied to each image in the set, based upon the complexity of the images.